package com.yc.system.service.impl;

import com.yc.system.mapper.SysUserRoleMapper;
import com.yc.system.service.ISysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author YanChen
 * @Date 2025/4/16 23:35
 **/
@Service
public class SysUserRoleServiceImpl implements ISysUserRoleService {

    @Autowired
    private SysUserRoleMapper sysUserRoleMapper;

    /**
     * @Author YanChen
     * @Description 查询用户角色信息
     * @Date 23:39 2025/4/16
     **/
    @Override
    public List<String> getRolesByUserId(Long userId) {
        return sysUserRoleMapper.selectRoleKeysByUserId(userId);
    }

    @Override
    public List<Long> getRoleIdsByUserId(Long userId) {
        return sysUserRoleMapper.selectRoleIdsByUserId(userId);
    }
}
